# -*- coding: utf-8 -*-
from django.db import models

# Create your models here.

class User(models.Model):
    userCode = models.CharField('用户编号', max_length=50, db_column='user_code', blank=True, unique=True)
    userName = models.CharField('用户名称', max_length=255, db_column='user_name', blank=True)
    password = models.CharField('密码', max_length=100, blank=True)
    email = models.EmailField('邮箱', blank=True)
    age = models.IntegerField('年龄', blank=True)
    sex = models.IntegerField('性别', default=0, choices=((1, '男'), (2, '女')))

    def __str__(self):
        return self.userName

    class Meta:
        # 设置默认新建表名
        db_table = 'user'
        verbose_name = '用户'
        verbose_name_plural = '用户'